/* rqidfp.p   - REQUISITIONS UTILITY SUBPGM TO GET/PUT UI KEY FIELDS          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3 $                                                           */
/*V8:ConvertMode=NoConvert                                                    */
/* Revision: 8.6    LAST MODIFIED: 05/05/97  By: B. Gates          *J1Q2*     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00  BY: *N0KP* Mark Brown            */
/* $Revision: 1.3 $    BY: Jean Miller           DATE: 04/16/02  ECO: *P05H*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

define temp-table ttfv no-undo
   field ttfv_field_name as character
   field ttfv_field_value as character
index ttfv_fv is unique primary
   ttfv_field_name.

PROCEDURE get_put:
   define input parameter p_action as character no-undo.
   define input parameter p_field_name as character no-undo.
   define input-output parameter p_field_value as character no-undo.

   if p_action = "get" then do:
      find ttfv where ttfv_field_name = p_field_name no-lock no-error.

      if available ttfv then
         p_field_value = ttfv_field_value.
      else
         p_field_value = "".
   end.

   else do:
      find ttfv where ttfv_field_name = p_field_name
      exclusive-lock no-error.

      if not available ttfv then do:
         create ttfv.
         ttfv_field_name = p_field_name.
      end.

      ttfv_field_value = p_field_value.
   end.

END PROCEDURE.
